package com.jbm.Community.Draw;

import android.annotation.SuppressLint;
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.util.AttributeSet;
import android.view.View;

public class ItemSeparateLineView extends View {
	int width = 0;
	public ItemSeparateLineView(Context context) {
		super(context);
	}
	public ItemSeparateLineView(Context context, AttributeSet attrs){
		super(context,attrs);
	}
	
	public ItemSeparateLineView(Context context, AttributeSet attrs, int defStyle){
		super(context,attrs,defStyle);
		setWillNotDraw(false);
	}
	
	@SuppressLint("DrawAllocation")
	@Override
	protected void onDraw(Canvas canvas)
	{
		super.onDraw(canvas);
		Paint paint = new Paint();
		
		paint.setAntiAlias(true);
		paint.setColor(Color.BLUE);
		paint.setStyle(Paint.Style.STROKE);
		paint.setStrokeWidth(1);
		
		//canvas.drawCircle(40, 40, 30, paint);
		canvas.drawLine(0, 3, this.width, 3, paint);
		invalidate();
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		this.width = widthMeasureSpec;
        setMeasuredDimension( widthMeasureSpec , 5) ;
	}		
}
